package com.google.android.wallet.sample;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;

public class SampleClientLib {

    private final Activity activity;
    
    public SampleClientLib(Activity activity){
        this.activity = activity;
    }
    
    public void doStuff(final CallbackHandler handler){
        new AlertDialog.Builder(activity)
            .setTitle("Hello SampleLib")
            .setPositiveButton("Success!", new DialogInterface.OnClickListener(){
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    handler.obtainMessage(CallbackHandler.SUCCESS).sendToTarget();
                }
            })
            .setNegativeButton("Failure...", new DialogInterface.OnClickListener(){
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    handler.obtainMessage(CallbackHandler.FAILURE).sendToTarget();
                }
            }).create().show();
    }
}
